package com.legoo.studaychineseonline.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.legoo.studaychineseonline.R;
import com.legoo.studaychineseonline.adapter.ActivityFragmentAdapter;
import com.legoo.studaychineseonline.base.BaseFragment;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

public class ActivityFragment extends BaseFragment {
    @BindView(R.id.tv_title_left)
    TextView tvTitleLeft;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_title_right)
    TextView tvTitleRight;
    @BindView(R.id.rv_activity)
    RecyclerView rvActivity;
    @BindView(R.id.sr_refresh)
    SmartRefreshLayout srRefresh;
    Unbinder unbinder;
    List<String> list = new ArrayList();
    @Override
    protected void initView(View view, Bundle savedInstanceState) {
        unbinder = ButterKnife.bind(this, view);
        tvTitleLeft.setVisibility(View.INVISIBLE);
        tvTitleRight.setVisibility(View.INVISIBLE);
        tvTitle.setText("我的活动");
        srRefresh.setOnRefreshListener(new OnRefreshListener() {
            @Override
            public void onRefresh(@NonNull RefreshLayout refreshLayout) {

            }
        });
        list.add("0");
        list.add("0");
        list.add("0");
        rvActivity.setLayoutManager(new LinearLayoutManager(context,LinearLayoutManager.VERTICAL,false));
        rvActivity.setAdapter(new ActivityFragmentAdapter(R.layout.item_activity,list));
    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_activity;
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.tv_title_left, R.id.tv_title})
    public void onViewClicked(View view) {
        switch (view.getId()) {

        }
    }
}
